package me.bcloud.web.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import me.bcloud.web.domain.User;

import org.springframework.stereotype.Controller;

@Controller("login")
public class Login extends HttpServlet {

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
	
		User user=new User();
		user.setUserid(req.getParameter("u"));
		user.setPassword(req.getParameter("p"));
		req.getSession().setAttribute("user",user );
		resp.sendRedirect("manager/list");
	}
}
